package com.aptech.domain.JPA;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * News entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "NEWS", schema = "dbo", catalog = "Blue_Pumpkin")
public class News implements java.io.Serializable {

	// Fields

	private Integer newsId;
	private Account account;
	private NewsCategory newsCategory;
	private String title;
	private String newsContent;
	private String newsDescription;
	private Timestamp createdDate;

	// Constructors

	/** default constructor */
	public News() {
	}

	/** minimal constructor */
	public News(Integer newsId, Account account, NewsCategory newsCategory) {
		this.newsId = newsId;
		this.account = account;
		this.newsCategory = newsCategory;
	}

	/** full constructor */
	public News(Integer newsId, Account account, NewsCategory newsCategory,
			String title, String newsContent, String newsDescription,
			Timestamp createdDate) {
		this.newsId = newsId;
		this.account = account;
		this.newsCategory = newsCategory;
		this.title = title;
		this.newsContent = newsContent;
		this.newsDescription = newsDescription;
		this.createdDate = createdDate;
	}

	// Property accessors
	@Id
	@Column(name = "NEWS_ID", unique = true, nullable = false)
	public Integer getNewsId() {
		return this.newsId;
	}

	public void setNewsId(Integer newsId) {
		this.newsId = newsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ACCOUNT_ID", nullable = false)
	public Account getAccount() {
		return this.account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "NEWS_CATEGORY_ID", nullable = false)
	public NewsCategory getNewsCategory() {
		return this.newsCategory;
	}

	public void setNewsCategory(NewsCategory newsCategory) {
		this.newsCategory = newsCategory;
	}

	@Column(name = "TITLE", length = 250)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "NEWS_CONTENT", length = 1073741823)
	public String getNewsContent() {
		return this.newsContent;
	}

	public void setNewsContent(String newsContent) {
		this.newsContent = newsContent;
	}

	@Column(name = "NEWS_DESCRIPTION", length = 500)
	public String getNewsDescription() {
		return this.newsDescription;
	}

	public void setNewsDescription(String newsDescription) {
		this.newsDescription = newsDescription;
	}

	@Column(name = "CREATED_DATE", length = 23)
	public Timestamp getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Timestamp createdDate) {
		this.createdDate = createdDate;
	}

}